package com.itjeffrey.autocode.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.itjeffrey.autocode.bo.req.IsEnableBO;
import com.itjeffrey.autocode.entity.RoleInfoTbEntity;
import com.itjeffrey.autocode.entity.RoleResEntity;
import com.itjeffrey.autocode.entity.UserRoleEntity;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 持久层接口
 * @author: admin
 * @date: 2021-03-28 12:26:46
 */
public interface RoleInfoTbMapper extends BaseMapper<RoleInfoTbEntity> {

    List<RoleInfoTbEntity> queryRoleInfosByUsername(@Param("username") String username);

    int addUserRole(UserRoleEntity userRoleEntity);

    int addResRole(RoleResEntity roleResEntity);

    void isEnableRole(IsEnableBO isEnableBO);

    List<RoleInfoTbEntity> queryRolesOutOfSelfRole(@Param("roleName") String roleName);

    List<RoleInfoTbEntity> queryRoleInfosByLoginName(@Param("loginName") String loginName);
}
